*Master Analysis dofile High Hopes
*This do file will generate 5 rgeression tables and 3 graphs for the High Hopes paper


clear all
set more off


*******************************************************************************
*SSC PACKAGES
******************************************************************************* 
*ssc packages needed to run these do files

ssc install ivreg2, replace
ssc install ranktest, replace
ssc install parmest, replace
ssc install cmp, replace
ssc install orth_out, replace
ssc install estout, replace
ssc install ghk2, replace
 

*******************************************************************************
*Working Directory {INPUT REQUIRED}
******************************************************************************* 
 
 
global wd "enter_address_to_the_replication_folder/HighHopes_Replication"
*Change the working directory to the folder where the High Hopes folder was unzipped/extracted

*******************************************************************************
*Globals
*******************************************************************************

global output "$wd/03_output"
global merge_mobile "$wd/01_data/final_mobile_merge.dta"  //respondent level dataset, merged baseline-endline-admin data
global merge_scores "$wd/01_data/final_endline_scores_merge.dta" //child level dataset from endline with baseline characteristics imported from baseline
global admin_agg "$wd/01_data/final_admin_aggregated.dta" //aggregated admin data (Graph 1 only)


*******************************************************************************
*USER-WRITTEN STATA PROGRAMS
******************************************************************************* 

*Additional programs needed to run this Programs needed to run the do files:
do "$wd/02_analysis/_Program_01_kl_binary.do" //Kling Liebman Imputation for binary var
do "$wd/02_analysis/_Program_02_kl_cont.do" //Kling Liebman Imputation for continuous var
do "$wd/02_analysis/_Program_03_comp_mean_TOT.do" // to calculate Mean of "Compliers'" in control



*******************
*Regression Tables
*******************
*Table 1: Balance 1
do "$wd/02_analysis/Table_01_balance.do"

*Table 2: Balance 2
do "$wd/02_analysis/Table_02_balance.do"

*Table 3: Takeup
do "$wd/02_analysis/Table_03_takeup.do"

*Table 4: Education outcomes
do "$wd/02_analysis/Table_04_enroll.do"

*Table 5: Mobile Balances
do "$wd/02_analysis/Table_05_mobile_balances.do"


********
*Graphs
********

do "$wd/02_analysis/Graph_01_deposit_withdrawal.do" //Graph 1
do "$wd/02_analysis/Graph_02a_enrollment.do" //Graph 2a
do "$wd/02_analysis/Graph_02b_Gross_Fin_Savings.do" //Graph 2b


exit 